/** <a href="http://www.cpupk.com/decompiler">Eclipse Class Decompiler</a> plugin, Copyright (c) 2017 Chen Chao. **/
package com.minierp.dao.hibernate;

import com.minierp.dao.WorkCenterDao;
import com.minierp.dao.hibernate.BaseDaoImpl;
import java.util.List;

public class WorkCenterDaoImpl extends BaseDaoImpl implements WorkCenterDao {
	public List getList(boolean justEnabled) {
		String sql = "from com.minierp.model.WorkCenter c";
		if (justEnabled) {
			sql = sql + " where c.enabled=\'Y\'";
		}

		sql = sql + " order by c.id";
		return this.getHibernateTemplate().find(sql);
	}

	public List getList(long userId) {
		String sql = "select c from com.minierp.model.WorkCenter c,com.minierp.model.UserPo u where c.id=u.poId and u.poType=\'WC\' and u.userId="
				+ userId + " and c.enabled=\'Y\'" + " order by c.id";
		return this.getHibernateTemplate().find(sql);
	}
}